﻿using System;
using System.ComponentModel;

namespace HalconDotNet
{
	/// <summary>Represents an instance of a surface matching result.</summary>
	// Token: 0x02000067 RID: 103
	public class HSurfaceMatchingResult : HHandle
	{
		// Token: 0x0600186D RID: 6253 RVA: 0x0000883B File Offset: 0x00006A3B
		[EditorBrowsable(EditorBrowsableState.Never)]
		public HSurfaceMatchingResult() : base(HHandleBase.UNDEF)
		{
		}

		// Token: 0x0600186E RID: 6254 RVA: 0x0009C40C File Offset: 0x0009A60C
		[EditorBrowsable(EditorBrowsableState.Never)]
		public HSurfaceMatchingResult(IntPtr handle) : base(handle)
		{
			this.AssertSemType();
		}

		// Token: 0x0600186F RID: 6255 RVA: 0x0009C41B File Offset: 0x0009A61B
		[EditorBrowsable(EditorBrowsableState.Never)]
		public HSurfaceMatchingResult(HHandle handle) : base(handle)
		{
			this.AssertSemType();
		}

		// Token: 0x06001870 RID: 6256 RVA: 0x0009C42A File Offset: 0x0009A62A
		private void AssertSemType()
		{
			base.AssertSemType("surface_matching_result");
		}

		// Token: 0x06001871 RID: 6257 RVA: 0x0009C437 File Offset: 0x0009A637
		internal static int LoadNew(IntPtr proc, int parIndex, int err, out HSurfaceMatchingResult obj)
		{
			obj = new HSurfaceMatchingResult(HHandleBase.UNDEF);
			return obj.Load(proc, parIndex, err);
		}

		// Token: 0x06001872 RID: 6258 RVA: 0x0009C450 File Offset: 0x0009A650
		internal static int LoadNew(IntPtr proc, int parIndex, int err, out HSurfaceMatchingResult[] obj)
		{
			HTuple htuple;
			err = HTuple.LoadNew(proc, parIndex, err, out htuple);
			obj = new HSurfaceMatchingResult[htuple.Length];
			for (int i = 0; i < htuple.Length; i++)
			{
				obj[i] = new HSurfaceMatchingResult(HalconAPI.IsLegacyHandleMode() ? htuple[i].IP : htuple[i].H);
			}
			htuple.Dispose();
			return err;
		}

		/// <summary>
		///   Get details of a result from surface based matching.
		///   Instance represents: Handle of the surface matching result.
		/// </summary>
		/// <param name="resultName">Name of the result property. Default: "pose"</param>
		/// <param name="resultIndex">Index of the matching result, starting with 0. Default: 0</param>
		/// <returns>Value of the result property.</returns>
		// Token: 0x06001873 RID: 6259 RVA: 0x0009C4C0 File Offset: 0x0009A6C0
		public HTuple GetSurfaceMatchingResult(HTuple resultName, int resultIndex)
		{
			IntPtr proc = HalconAPI.PreCall(1032);
			base.Store(proc, 0);
			HalconAPI.Store(proc, 1, resultName);
			HalconAPI.StoreI(proc, 2, resultIndex);
			HalconAPI.InitOCT(proc, 0);
			int num = HalconAPI.CallProcedure(proc);
			HalconAPI.UnpinTuple(resultName);
			HTuple result;
			num = HTuple.LoadNew(proc, 0, num, out result);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			return result;
		}

		/// <summary>
		///   Get details of a result from surface based matching.
		///   Instance represents: Handle of the surface matching result.
		/// </summary>
		/// <param name="resultName">Name of the result property. Default: "pose"</param>
		/// <param name="resultIndex">Index of the matching result, starting with 0. Default: 0</param>
		/// <returns>Value of the result property.</returns>
		// Token: 0x06001874 RID: 6260 RVA: 0x0009C520 File Offset: 0x0009A720
		public HTuple GetSurfaceMatchingResult(string resultName, int resultIndex)
		{
			IntPtr proc = HalconAPI.PreCall(1032);
			base.Store(proc, 0);
			HalconAPI.StoreS(proc, 1, resultName);
			HalconAPI.StoreI(proc, 2, resultIndex);
			HalconAPI.InitOCT(proc, 0);
			int num = HalconAPI.CallProcedure(proc);
			HTuple result;
			num = HTuple.LoadNew(proc, 0, num, out result);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			return result;
		}

		/// <summary>Free the memory of a surface matching result.</summary>
		/// <param name="surfaceMatchingResultID">Handle of the surface matching result.</param>
		// Token: 0x06001875 RID: 6261 RVA: 0x0009C578 File Offset: 0x0009A778
		public static void ClearSurfaceMatchingResult(HSurfaceMatchingResult[] surfaceMatchingResultID)
		{
			HTuple htuple = HHandleBase.ConcatArray(surfaceMatchingResultID);
			IntPtr proc = HalconAPI.PreCall(1034);
			HalconAPI.Store(proc, 0, htuple);
			int procResult = HalconAPI.CallProcedure(proc);
			HalconAPI.UnpinTuple(htuple);
			HalconAPI.PostCall(proc, procResult);
			GC.KeepAlive(surfaceMatchingResultID);
		}

		/// <summary>
		///   Free the memory of a surface matching result.
		///   Instance represents: Handle of the surface matching result.
		/// </summary>
		// Token: 0x06001876 RID: 6262 RVA: 0x0009C5BC File Offset: 0x0009A7BC
		public void ClearSurfaceMatchingResult()
		{
			IntPtr proc = HalconAPI.PreCall(1034);
			base.Store(proc, 0);
			int procResult = HalconAPI.CallProcedure(proc);
			HalconAPI.PostCall(proc, procResult);
			GC.KeepAlive(this);
		}

		/// <summary>Refine the pose of a surface model in a 3D scene.</summary>
		/// <param name="surfaceModelID">Handle of the surface model.</param>
		/// <param name="objectModel3D">Handle of the 3D object model containing the scene.</param>
		/// <param name="initialPose">Initial pose of the surface model in the scene.</param>
		/// <param name="minScore">Minimum score of the returned poses. Default: 0</param>
		/// <param name="returnResultHandle">Enable returning a result handle in SurfaceMatchingResultID. Default: "false"</param>
		/// <param name="genParamName">Names of the generic parameters. Default: []</param>
		/// <param name="genParamValue">Values of the generic parameters. Default: []</param>
		/// <param name="score">Score of the found instances of the model.</param>
		/// <param name="surfaceMatchingResultID">Handle of the matching result, if enabled in ReturnResultHandle.</param>
		/// <returns>3D pose of the surface model in the scene.</returns>
		// Token: 0x06001877 RID: 6263 RVA: 0x0009C5F0 File Offset: 0x0009A7F0
		public static HPose[] RefineSurfaceModelPose(HSurfaceModel surfaceModelID, HObjectModel3D objectModel3D, HPose[] initialPose, HTuple minScore, string returnResultHandle, HTuple genParamName, HTuple genParamValue, out HTuple score, out HSurfaceMatchingResult[] surfaceMatchingResultID)
		{
			HTuple htuple = HData.ConcatArray(initialPose);
			IntPtr proc = HalconAPI.PreCall(1041);
			HalconAPI.Store(proc, 0, surfaceModelID);
			HalconAPI.Store(proc, 1, objectModel3D);
			HalconAPI.Store(proc, 2, htuple);
			HalconAPI.Store(proc, 3, minScore);
			HalconAPI.StoreS(proc, 4, returnResultHandle);
			HalconAPI.Store(proc, 5, genParamName);
			HalconAPI.Store(proc, 6, genParamValue);
			HalconAPI.InitOCT(proc, 0);
			HalconAPI.InitOCT(proc, 1);
			HalconAPI.InitOCT(proc, 2);
			int num = HalconAPI.CallProcedure(proc);
			HalconAPI.UnpinTuple(htuple);
			HalconAPI.UnpinTuple(minScore);
			HalconAPI.UnpinTuple(genParamName);
			HalconAPI.UnpinTuple(genParamValue);
			HTuple data;
			num = HTuple.LoadNew(proc, 0, num, out data);
			num = HTuple.LoadNew(proc, 1, HTupleType.DOUBLE, num, out score);
			num = HSurfaceMatchingResult.LoadNew(proc, 2, num, out surfaceMatchingResultID);
			HalconAPI.PostCall(proc, num);
			HPose[] result = HPose.SplitArray(data);
			GC.KeepAlive(surfaceModelID);
			GC.KeepAlive(objectModel3D);
			return result;
		}

		/// <summary>
		///   Refine the pose of a surface model in a 3D scene.
		///   Modified instance represents: Handle of the matching result, if enabled in ReturnResultHandle.
		/// </summary>
		/// <param name="surfaceModelID">Handle of the surface model.</param>
		/// <param name="objectModel3D">Handle of the 3D object model containing the scene.</param>
		/// <param name="initialPose">Initial pose of the surface model in the scene.</param>
		/// <param name="minScore">Minimum score of the returned poses. Default: 0</param>
		/// <param name="returnResultHandle">Enable returning a result handle in SurfaceMatchingResultID. Default: "false"</param>
		/// <param name="genParamName">Names of the generic parameters. Default: []</param>
		/// <param name="genParamValue">Values of the generic parameters. Default: []</param>
		/// <param name="score">Score of the found instances of the model.</param>
		/// <returns>3D pose of the surface model in the scene.</returns>
		// Token: 0x06001878 RID: 6264 RVA: 0x0009C6C0 File Offset: 0x0009A8C0
		public HPose RefineSurfaceModelPose(HSurfaceModel surfaceModelID, HObjectModel3D objectModel3D, HPose initialPose, double minScore, string returnResultHandle, HTuple genParamName, HTuple genParamValue, out HTuple score)
		{
			this.Dispose();
			IntPtr proc = HalconAPI.PreCall(1041);
			HalconAPI.Store(proc, 0, surfaceModelID);
			HalconAPI.Store(proc, 1, objectModel3D);
			HalconAPI.Store(proc, 2, initialPose);
			HalconAPI.StoreD(proc, 3, minScore);
			HalconAPI.StoreS(proc, 4, returnResultHandle);
			HalconAPI.Store(proc, 5, genParamName);
			HalconAPI.Store(proc, 6, genParamValue);
			HalconAPI.InitOCT(proc, 2);
			HalconAPI.InitOCT(proc, 0);
			HalconAPI.InitOCT(proc, 1);
			int num = HalconAPI.CallProcedure(proc);
			HalconAPI.UnpinTuple(initialPose);
			HalconAPI.UnpinTuple(genParamName);
			HalconAPI.UnpinTuple(genParamValue);
			num = base.Load(proc, 2, num);
			HPose result;
			num = HPose.LoadNew(proc, 0, num, out result);
			num = HTuple.LoadNew(proc, 1, HTupleType.DOUBLE, num, out score);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			GC.KeepAlive(surfaceModelID);
			GC.KeepAlive(objectModel3D);
			return result;
		}

		/// <summary>Find the best matches of a surface model in a 3D scene.</summary>
		/// <param name="surfaceModelID">Handle of the surface model.</param>
		/// <param name="objectModel3D">Handle of the 3D object model containing the scene.</param>
		/// <param name="relSamplingDistance">Scene sampling distance relative to the diameter of the surface model. Default: 0.05</param>
		/// <param name="keyPointFraction">Fraction of sampled scene points used as key points. Default: 0.2</param>
		/// <param name="minScore">Minimum score of the returned poses. Default: 0</param>
		/// <param name="returnResultHandle">Enable returning a result handle in SurfaceMatchingResultID. Default: "false"</param>
		/// <param name="genParamName">Names of the generic parameters. Default: []</param>
		/// <param name="genParamValue">Values of the generic parameters. Default: []</param>
		/// <param name="score">Score of the found instances of the surface model.</param>
		/// <param name="surfaceMatchingResultID">Handle of the matching result, if enabled in ReturnResultHandle.</param>
		/// <returns>3D pose of the surface model in the scene.</returns>
		// Token: 0x06001879 RID: 6265 RVA: 0x0009C794 File Offset: 0x0009A994
		public static HPose[] FindSurfaceModel(HSurfaceModel surfaceModelID, HObjectModel3D objectModel3D, double relSamplingDistance, double keyPointFraction, HTuple minScore, string returnResultHandle, HTuple genParamName, HTuple genParamValue, out HTuple score, out HSurfaceMatchingResult[] surfaceMatchingResultID)
		{
			IntPtr proc = HalconAPI.PreCall(1042);
			HalconAPI.Store(proc, 0, surfaceModelID);
			HalconAPI.Store(proc, 1, objectModel3D);
			HalconAPI.StoreD(proc, 2, relSamplingDistance);
			HalconAPI.StoreD(proc, 3, keyPointFraction);
			HalconAPI.Store(proc, 4, minScore);
			HalconAPI.StoreS(proc, 5, returnResultHandle);
			HalconAPI.Store(proc, 6, genParamName);
			HalconAPI.Store(proc, 7, genParamValue);
			HalconAPI.InitOCT(proc, 0);
			HalconAPI.InitOCT(proc, 1);
			HalconAPI.InitOCT(proc, 2);
			int num = HalconAPI.CallProcedure(proc);
			HalconAPI.UnpinTuple(minScore);
			HalconAPI.UnpinTuple(genParamName);
			HalconAPI.UnpinTuple(genParamValue);
			HTuple data;
			num = HTuple.LoadNew(proc, 0, num, out data);
			num = HTuple.LoadNew(proc, 1, HTupleType.DOUBLE, num, out score);
			num = HSurfaceMatchingResult.LoadNew(proc, 2, num, out surfaceMatchingResultID);
			HalconAPI.PostCall(proc, num);
			HPose[] result = HPose.SplitArray(data);
			GC.KeepAlive(surfaceModelID);
			GC.KeepAlive(objectModel3D);
			return result;
		}

		/// <summary>
		///   Find the best matches of a surface model in a 3D scene.
		///   Modified instance represents: Handle of the matching result, if enabled in ReturnResultHandle.
		/// </summary>
		/// <param name="surfaceModelID">Handle of the surface model.</param>
		/// <param name="objectModel3D">Handle of the 3D object model containing the scene.</param>
		/// <param name="relSamplingDistance">Scene sampling distance relative to the diameter of the surface model. Default: 0.05</param>
		/// <param name="keyPointFraction">Fraction of sampled scene points used as key points. Default: 0.2</param>
		/// <param name="minScore">Minimum score of the returned poses. Default: 0</param>
		/// <param name="returnResultHandle">Enable returning a result handle in SurfaceMatchingResultID. Default: "false"</param>
		/// <param name="genParamName">Names of the generic parameters. Default: []</param>
		/// <param name="genParamValue">Values of the generic parameters. Default: []</param>
		/// <param name="score">Score of the found instances of the surface model.</param>
		/// <returns>3D pose of the surface model in the scene.</returns>
		// Token: 0x0600187A RID: 6266 RVA: 0x0009C860 File Offset: 0x0009AA60
		public HPose FindSurfaceModel(HSurfaceModel surfaceModelID, HObjectModel3D objectModel3D, double relSamplingDistance, double keyPointFraction, double minScore, string returnResultHandle, HTuple genParamName, HTuple genParamValue, out HTuple score)
		{
			this.Dispose();
			IntPtr proc = HalconAPI.PreCall(1042);
			HalconAPI.Store(proc, 0, surfaceModelID);
			HalconAPI.Store(proc, 1, objectModel3D);
			HalconAPI.StoreD(proc, 2, relSamplingDistance);
			HalconAPI.StoreD(proc, 3, keyPointFraction);
			HalconAPI.StoreD(proc, 4, minScore);
			HalconAPI.StoreS(proc, 5, returnResultHandle);
			HalconAPI.Store(proc, 6, genParamName);
			HalconAPI.Store(proc, 7, genParamValue);
			HalconAPI.InitOCT(proc, 2);
			HalconAPI.InitOCT(proc, 0);
			HalconAPI.InitOCT(proc, 1);
			int num = HalconAPI.CallProcedure(proc);
			HalconAPI.UnpinTuple(genParamName);
			HalconAPI.UnpinTuple(genParamValue);
			num = base.Load(proc, 2, num);
			HPose result;
			num = HPose.LoadNew(proc, 0, num, out result);
			num = HTuple.LoadNew(proc, 1, HTupleType.DOUBLE, num, out score);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			GC.KeepAlive(surfaceModelID);
			GC.KeepAlive(objectModel3D);
			return result;
		}

		/// <summary>Find the best matches of a surface model in a 3D scene and images.</summary>
		/// <param name="image">Images of the scene.</param>
		/// <param name="surfaceModelID">Handle of the surface model.</param>
		/// <param name="objectModel3D">Handle of the 3D object model containing the scene.</param>
		/// <param name="relSamplingDistance">Scene sampling distance relative to the diameter of the surface model. Default: 0.05</param>
		/// <param name="keyPointFraction">Fraction of sampled scene points used as key points. Default: 0.2</param>
		/// <param name="minScore">Minimum score of the returned poses. Default: 0</param>
		/// <param name="returnResultHandle">Enable returning a result handle in SurfaceMatchingResultID. Default: "false"</param>
		/// <param name="genParamName">Names of the generic parameters. Default: []</param>
		/// <param name="genParamValue">Values of the generic parameters. Default: []</param>
		/// <param name="score">Score of the found instances of the surface model.</param>
		/// <param name="surfaceMatchingResultID">Handle of the matching result, if enabled in ReturnResultHandle.</param>
		/// <returns>3D pose of the surface model in the scene.</returns>
		// Token: 0x0600187B RID: 6267 RVA: 0x0009C92C File Offset: 0x0009AB2C
		public static HPose[] FindSurfaceModelImage(HImage image, HSurfaceModel surfaceModelID, HObjectModel3D objectModel3D, double relSamplingDistance, double keyPointFraction, HTuple minScore, string returnResultHandle, HTuple genParamName, HTuple genParamValue, out HTuple score, out HSurfaceMatchingResult[] surfaceMatchingResultID)
		{
			IntPtr proc = HalconAPI.PreCall(2069);
			HalconAPI.Store(proc, 1, image);
			HalconAPI.Store(proc, 0, surfaceModelID);
			HalconAPI.Store(proc, 1, objectModel3D);
			HalconAPI.StoreD(proc, 2, relSamplingDistance);
			HalconAPI.StoreD(proc, 3, keyPointFraction);
			HalconAPI.Store(proc, 4, minScore);
			HalconAPI.StoreS(proc, 5, returnResultHandle);
			HalconAPI.Store(proc, 6, genParamName);
			HalconAPI.Store(proc, 7, genParamValue);
			HalconAPI.InitOCT(proc, 0);
			HalconAPI.InitOCT(proc, 1);
			HalconAPI.InitOCT(proc, 2);
			int num = HalconAPI.CallProcedure(proc);
			HalconAPI.UnpinTuple(minScore);
			HalconAPI.UnpinTuple(genParamName);
			HalconAPI.UnpinTuple(genParamValue);
			HTuple data;
			num = HTuple.LoadNew(proc, 0, num, out data);
			num = HTuple.LoadNew(proc, 1, HTupleType.DOUBLE, num, out score);
			num = HSurfaceMatchingResult.LoadNew(proc, 2, num, out surfaceMatchingResultID);
			HalconAPI.PostCall(proc, num);
			HPose[] result = HPose.SplitArray(data);
			GC.KeepAlive(image);
			GC.KeepAlive(surfaceModelID);
			GC.KeepAlive(objectModel3D);
			return result;
		}

		/// <summary>
		///   Find the best matches of a surface model in a 3D scene and images.
		///   Modified instance represents: Handle of the matching result, if enabled in ReturnResultHandle.
		/// </summary>
		/// <param name="image">Images of the scene.</param>
		/// <param name="surfaceModelID">Handle of the surface model.</param>
		/// <param name="objectModel3D">Handle of the 3D object model containing the scene.</param>
		/// <param name="relSamplingDistance">Scene sampling distance relative to the diameter of the surface model. Default: 0.05</param>
		/// <param name="keyPointFraction">Fraction of sampled scene points used as key points. Default: 0.2</param>
		/// <param name="minScore">Minimum score of the returned poses. Default: 0</param>
		/// <param name="returnResultHandle">Enable returning a result handle in SurfaceMatchingResultID. Default: "false"</param>
		/// <param name="genParamName">Names of the generic parameters. Default: []</param>
		/// <param name="genParamValue">Values of the generic parameters. Default: []</param>
		/// <param name="score">Score of the found instances of the surface model.</param>
		/// <returns>3D pose of the surface model in the scene.</returns>
		// Token: 0x0600187C RID: 6268 RVA: 0x0009CA04 File Offset: 0x0009AC04
		public HPose FindSurfaceModelImage(HImage image, HSurfaceModel surfaceModelID, HObjectModel3D objectModel3D, double relSamplingDistance, double keyPointFraction, double minScore, string returnResultHandle, HTuple genParamName, HTuple genParamValue, out HTuple score)
		{
			this.Dispose();
			IntPtr proc = HalconAPI.PreCall(2069);
			HalconAPI.Store(proc, 1, image);
			HalconAPI.Store(proc, 0, surfaceModelID);
			HalconAPI.Store(proc, 1, objectModel3D);
			HalconAPI.StoreD(proc, 2, relSamplingDistance);
			HalconAPI.StoreD(proc, 3, keyPointFraction);
			HalconAPI.StoreD(proc, 4, minScore);
			HalconAPI.StoreS(proc, 5, returnResultHandle);
			HalconAPI.Store(proc, 6, genParamName);
			HalconAPI.Store(proc, 7, genParamValue);
			HalconAPI.InitOCT(proc, 2);
			HalconAPI.InitOCT(proc, 0);
			HalconAPI.InitOCT(proc, 1);
			int num = HalconAPI.CallProcedure(proc);
			HalconAPI.UnpinTuple(genParamName);
			HalconAPI.UnpinTuple(genParamValue);
			num = base.Load(proc, 2, num);
			HPose result;
			num = HPose.LoadNew(proc, 0, num, out result);
			num = HTuple.LoadNew(proc, 1, HTupleType.DOUBLE, num, out score);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			GC.KeepAlive(image);
			GC.KeepAlive(surfaceModelID);
			GC.KeepAlive(objectModel3D);
			return result;
		}

		/// <summary>Refine the pose of a surface model in a 3D scene and in images.</summary>
		/// <param name="image">Images of the scene.</param>
		/// <param name="surfaceModelID">Handle of the surface model.</param>
		/// <param name="objectModel3D">Handle of the 3D object model containing the scene.</param>
		/// <param name="initialPose">Initial pose of the surface model in the scene.</param>
		/// <param name="minScore">Minimum score of the returned poses. Default: 0</param>
		/// <param name="returnResultHandle">Enable returning a result handle in SurfaceMatchingResultID. Default: "false"</param>
		/// <param name="genParamName">Names of the generic parameters. Default: []</param>
		/// <param name="genParamValue">Values of the generic parameters. Default: []</param>
		/// <param name="score">Score of the found instances of the model.</param>
		/// <param name="surfaceMatchingResultID">Handle of the matching result, if enabled in ReturnResultHandle.</param>
		/// <returns>3D pose of the surface model in the scene.</returns>
		// Token: 0x0600187D RID: 6269 RVA: 0x0009CAE0 File Offset: 0x0009ACE0
		public static HPose[] RefineSurfaceModelPoseImage(HImage image, HSurfaceModel surfaceModelID, HObjectModel3D objectModel3D, HPose[] initialPose, HTuple minScore, string returnResultHandle, HTuple genParamName, HTuple genParamValue, out HTuple score, out HSurfaceMatchingResult[] surfaceMatchingResultID)
		{
			HTuple htuple = HData.ConcatArray(initialPose);
			IntPtr proc = HalconAPI.PreCall(2084);
			HalconAPI.Store(proc, 1, image);
			HalconAPI.Store(proc, 0, surfaceModelID);
			HalconAPI.Store(proc, 1, objectModel3D);
			HalconAPI.Store(proc, 2, htuple);
			HalconAPI.Store(proc, 3, minScore);
			HalconAPI.StoreS(proc, 4, returnResultHandle);
			HalconAPI.Store(proc, 5, genParamName);
			HalconAPI.Store(proc, 6, genParamValue);
			HalconAPI.InitOCT(proc, 0);
			HalconAPI.InitOCT(proc, 1);
			HalconAPI.InitOCT(proc, 2);
			int num = HalconAPI.CallProcedure(proc);
			HalconAPI.UnpinTuple(htuple);
			HalconAPI.UnpinTuple(minScore);
			HalconAPI.UnpinTuple(genParamName);
			HalconAPI.UnpinTuple(genParamValue);
			HTuple data;
			num = HTuple.LoadNew(proc, 0, num, out data);
			num = HTuple.LoadNew(proc, 1, HTupleType.DOUBLE, num, out score);
			num = HSurfaceMatchingResult.LoadNew(proc, 2, num, out surfaceMatchingResultID);
			HalconAPI.PostCall(proc, num);
			HPose[] result = HPose.SplitArray(data);
			GC.KeepAlive(image);
			GC.KeepAlive(surfaceModelID);
			GC.KeepAlive(objectModel3D);
			return result;
		}

		/// <summary>
		///   Refine the pose of a surface model in a 3D scene and in images.
		///   Modified instance represents: Handle of the matching result, if enabled in ReturnResultHandle.
		/// </summary>
		/// <param name="image">Images of the scene.</param>
		/// <param name="surfaceModelID">Handle of the surface model.</param>
		/// <param name="objectModel3D">Handle of the 3D object model containing the scene.</param>
		/// <param name="initialPose">Initial pose of the surface model in the scene.</param>
		/// <param name="minScore">Minimum score of the returned poses. Default: 0</param>
		/// <param name="returnResultHandle">Enable returning a result handle in SurfaceMatchingResultID. Default: "false"</param>
		/// <param name="genParamName">Names of the generic parameters. Default: []</param>
		/// <param name="genParamValue">Values of the generic parameters. Default: []</param>
		/// <param name="score">Score of the found instances of the model.</param>
		/// <returns>3D pose of the surface model in the scene.</returns>
		// Token: 0x0600187E RID: 6270 RVA: 0x0009CBC0 File Offset: 0x0009ADC0
		public HPose RefineSurfaceModelPoseImage(HImage image, HSurfaceModel surfaceModelID, HObjectModel3D objectModel3D, HPose initialPose, double minScore, string returnResultHandle, HTuple genParamName, HTuple genParamValue, out HTuple score)
		{
			this.Dispose();
			IntPtr proc = HalconAPI.PreCall(2084);
			HalconAPI.Store(proc, 1, image);
			HalconAPI.Store(proc, 0, surfaceModelID);
			HalconAPI.Store(proc, 1, objectModel3D);
			HalconAPI.Store(proc, 2, initialPose);
			HalconAPI.StoreD(proc, 3, minScore);
			HalconAPI.StoreS(proc, 4, returnResultHandle);
			HalconAPI.Store(proc, 5, genParamName);
			HalconAPI.Store(proc, 6, genParamValue);
			HalconAPI.InitOCT(proc, 2);
			HalconAPI.InitOCT(proc, 0);
			HalconAPI.InitOCT(proc, 1);
			int num = HalconAPI.CallProcedure(proc);
			HalconAPI.UnpinTuple(initialPose);
			HalconAPI.UnpinTuple(genParamName);
			HalconAPI.UnpinTuple(genParamValue);
			num = base.Load(proc, 2, num);
			HPose result;
			num = HPose.LoadNew(proc, 0, num, out result);
			num = HTuple.LoadNew(proc, 1, HTupleType.DOUBLE, num, out score);
			HalconAPI.PostCall(proc, num);
			GC.KeepAlive(this);
			GC.KeepAlive(image);
			GC.KeepAlive(surfaceModelID);
			GC.KeepAlive(objectModel3D);
			return result;
		}
	}
}
